<?php

require_once('Classes/Xml/XmlDocument.php');

Mock::generate( 'XmlElement' );

class Test_XmlDocument extends UnitTestCase {
    
	function test_GenerateWillUseCallGenerateAgainstTheParentXmlElementClassAndPrefixItWithTheXmlVersionTag() {

		$oElement = new XmlDocument( 'Thing', 'SimpleTextContent' );
		$oElement->AddAttribute( 'attr1', 'value1' );
		$oElement->AddAttribute( 'attr2', 'value2' );

		$this->assertIdentical( $oElement->Generate(), "<?xml version=\"1.0\"?>\r\n\r\n<THING attr1=\"value1\" attr2=\"value2\">SimpleTextContent</THING>" );
	}

}

?>
